\documentclass[11pt,twoside]{article}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% End Document Specs Here 
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%------------page layout
\usepackage[left=2cm,top=3cm,right=2cm,bottom=2cm]{geometry} %changes margins
\usepackage[parfill]{parskip} % begin paragraphs with an empty line not indent
\usepackage{multicol}

%%-----------section styles
\usepackage{sectsty}
        %Put period after section number
\makeatletter
\def\@seccntformat#1{\@ifundefined{#1@cntformat}% 
{\csname the#1\endcsname\quad}% default 
{\csname #1@cntformat\endcsname}% individual control 
}
\def\section@cntformat{\thesection.\quad}
\def\subsection@cntformat{\thesubsection.\quad}
\makeatother
\sectionfont{\bf\large\raggedright}
\subsectionfont{\bf\normalsize\raggedright}
\subsubsectionfont{\bf}

%%------------font choices
%\usepackage[math]{anttor}
%\usepackage[varg]{txfonts}
%\usepackage[scaled=.9]{couriers}
%\usepackage[utopia]{mathdesign}
%\usepackage{fourier}
\usepackage{palatino}

%%------------graphics
\usepackage{graphicx,epstopdf}
\usepackage{subfigure}

%%------------mathematics
\usepackage{amsmath,amssymb,amsthm}

%%------------bibliography
\usepackage{natbib}
%\setcitestyle{square,aysep={},yysep={;}}
\bibliographystyle{../../group/agufull04}%abbrvnat,plainnat,unsrtnat

%%------------tables
\usepackage{booktabs}

%%------------misc
\usepackage{verbatim}
\usepackage[pdftex,bookmarks,colorlinks,breaklinks]{hyperref}
\hypersetup{linkcolor=black,citecolor=black,filecolor=black,urlcolor=black}

%%-----------custom environments
%%enumerate and itemize with smaller spacing
\newenvironment{myen}{
\begin{enumerate}
  \setlength{\itemsep}{1pt}
  \setlength{\parskip}{0pt}
  \setlength{\parsep}{0pt}}{\end{enumerate}
}
\newenvironment{myit}{
\begin{itemize}
  \setlength{\itemsep}{1pt}
  \setlength{\parskip}{0pt}
  \setlength{\parsep}{0pt}}{\end{itemize}
}
\renewcommand{\[}{\begin{equation}}
\renewcommand{\]}{\end{equation}}


%%-----------page header declaration
\newcommand{\Ohead}{E492 FALL 2008}                        %header for Odd pages
\newcommand{\Ehead}{ARCATA BRACKISH MARSH}  %header for Even pages
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhead[CE]{\small \Ehead}
\fancyhead[CO]{\small \Ohead}
\fancyhead[LE,RO]{\thepage}   %page numbers

%%-----------nicer looking captions
\usepackage[font={bf,footnotesize},textfont=md,margin=30pt,aboveskip=0pt,belowskip=0pt]{caption}

%%-----------PGF/TIKZ
%\usepackage{tikz}
\usepackage{pgf}
%\usetikzlibrary{arrows,shapes,positioning}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% End Document Specs Here 
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% Document Starts Here 
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{empty}

~\vspace{8cm}
\begin{center}
    \textbf{\Large Arcata Brackish Marsh Capstone Project\\Individual Writing Component}
    {\bf\\ Neil Berezovsky \\}
    E492 October, 2008
\end{center}
\clearpage

\thispagestyle{empty}
\tableofcontents
\listoffigures
\listoftables
\clearpage

\setcounter{page}{1}

\section{Introduction}

This paper will discuss the development of a predictive hydraulic model of Arcata's constructed wetlands and the motivation behind such a project. Recent development of a tidally-influenced brackish marsh adjacent to Arcata's constructed wetlands has given rise to various questions regarding integration of the new marsh into the existing treatment system. The goal of our project is two-fold: (1) to develop a predictive hydraulic model capable of simulating likely scenarios in order to better understand the hydraulic behavior of the wetlands, and (2) to develop an operational tool that will be used to manage the constructed wetlands and respond to forecasted conditions. 

Section 2 of this paper describes the hydraulic and ecological setting of the existing marsh system and likely future scenarios. Section 2 also details the motivation behind the brackish-marsh project and the requirements placed upon the Arcata Wastewater Treatment Facility (AWTF). Section 3 summarizes relevant previous work related to hydrologic analysis (e.g., precipitation and tidal forecasting) and wetland hydraulics (e.g., equations of flow through dense vegitation). Sections 4 and 5 present the analyses and computational methods used to develop the site-specific simulation model of Arcata's constructed wetlands.   

\section{Background}\label{sec:back}

\subsection{Existing Conditions}

Arcata's wastewater treatment facility utilizes a series of constructed wetlands to remove suspended solids and organic matter from the waste stream. After primary treatment, i.e., screening and clarification, effluent is pumped to an elevational high point, and flows down gradient through the wetland system (Figure \ref{aerial}). Three oxidation ponds connected in series are responsible for the removal of organic matter (Biological Oxygen Demand, BOD). From the oxidation ponds, effluent flows in parallel to a set of treatment marshes, where thick vegitation acts to filter suspended solids, e.g., algae, from the waste stream and provides a substrate for symbiotic microorganims which further decompose organic waste. Effluent from the treatment marshes collects in a stilling-well and is pumped to a chlorine contact basin for disinfection. 

After chlorination, a portion of the effluent flows by gravity through three enhancement wetlands in series - herein referred to as Allen, Gearheart, and Hauser. The enhancement wetlands provide ample opportunity for oxidation of organic matter and solids-settling, greatly increasing the quality of the effluent. At the downstream end of the enhancement marshes, effluent is pumped back to the chlorine basin and combined with effluent from the treatment marshes to dilute, in a sense, the wastestream. Finally, the portion of chlorinated effluent not sent to the enhancement wetlands is discharged to Humboldt Bay via Butcher's slough. 

\begin{figure}[ht]
\centering
\input{figs/aerial.pgf}
\caption{Aerial view of the contructed wetlands.}\label{aerial}
\end{figure}

The treatment facility, built in 1984, was designed to treat an average of 2.3 million gallons per day (mgd) \citep{CH2MHILL}. In recent winter months, flows have exceeded 13.6 mgd as a result of excessive stormwater infiltration. Numerous violations of the effluent discharge permit have occured as a result of the high flows during extreme events \citep{CRWQCB2008}.

Discharge from the treatment facility is regulated by federal, state, and regional agencies. The current discharge permit (NPDES Permit No. CA0022713) was granted in June 2004 and will expire in June 2009. The permit allows two points of discharge: Outfall No. 001 into Butcher's Slough, and Outfall No. 002 into Allen Marsh - both outfalls are directly downstream of the chlorine basin. The permit places limits upon the daily volumetric flow of discharge and concentration of water quality constituents (Tables \ref{tab:001}, and \ref{tab:002}). From the stand point of the City of Arcata, the newly developed brackish marsh presents an opportunity to expand the treatment capacity of the existing facility, and thereby to mitigate future violations of the discharge permit. 
 
%\begin{table}[!htbp]
%   \centering
%   \caption{Incremental pumping capacity based on various pumping scenarios.}
%   \begin{tabular}{@{} ccccc @{}}
%      \toprule
%      TM Pumps & Ox Pond 1 Pumps & Ox Pond 2 Pumps & Ox Pond 3 Pumps & Pump Capacity (MGD) \\
%      \midrule
%      2 & 1 & 0 & 0 & 4.5 \\
%      3 & 1 & 0 & 0 & 4.9 \\
%      3 & 3 & 0 & 0 & 6.0 \\
%      3 & 3 & 0 & 1 & 7.5 \\
%      3 & 3 & 0 & 2 & 8.4 \\
%      3 & 3 & 1 & 2 & 11.9 \\
%      3 & 3 & 2 & 2 & 13.6 \\
%      \bottomrule
%   \end{tabular}\label{tab:high-flow}
%\end{table}

\begin{table}[!ht]
   \centering
   \caption{Discharge limitations at Outfall No. 001 \citep{CRWQCB2004}.}
   \begin{tabular}{@{} ccccc @{}}
      \toprule
        & Units & Monthly Average & Weekly Average & Daily Maximum \\
      \midrule
      BOD$_5$           & mg/L      & 30                  & 45 & 60   \\
      Suspended Solids  & mg/L      & 30                  & 45 & 60   \\
      Settleable Solids & mL/L      & 0.1                 & -  & 0.2  \\
      Fecal Coliform    & MPN/100mL & 14                  & -  & 43   \\
      pH                & Standard  & $>$ 6.0 and $<$ 9.0 &    &      \\
      Copper            & $\mu$g/L  & 2.8                 & -  & 5.7  \\
      Zinc              & $\mu$g/L  & 47                  & -  & 95   \\
      Cyanide           & $\mu$g/L  & 0.5                 & -  & 1.0  \\
      2,3,7,8-TCDD TEQ  & pg/L      & 0.014               & -  & 0.028\\
      \bottomrule
   \end{tabular}\label{tab:001}
\end{table}

\begin{table}[!htb]
   \centering
   \caption{Discharge limitations at Outfall No. 002 \citep{CRWQCB2004}.}
   \begin{tabular}{@{} ccccc @{}}
      \toprule
        & Units & Monthly Average & Weekly Average & Daily Maximum \\
      \midrule
      BOD$_5$           & mg/L      & 30                  & 45 & 60   \\
      Suspended Solids  & mg/L      & 30                  & 45 & 60   \\
      Settleable Solids & mL/L      & 0.1                 & -  & 0.2  \\
      Fecal Coliform    & MPN/100mL & 23                  & -  & 230   \\
      pH                & Standard  & $>$ 6.0 and $<$ 9.0 &    &      \\
      \bottomrule
   \end{tabular}\label{tab:002}
\end{table}

\subsection{Proposed Hydraulic Regimes}

Likely scenarios for integrating the brackish marsh with the existing wetlands are shown in Figures \ref{fig:tm-current} through \ref{fig:tm-none}. Selection of the best alternative depends largely on the location and constraints of the discharge permit currently under negotiation \citep{Andre2008}. The North Coast Regional Water Quality Board (NCRWQB) wishes to designate the enhancement marshes as ``waters of the United States,'' thereby removing them from the treatment system \citep{Andre2008}. Such a descision would: (1) decrease the capacity of the treatment facility to buffer high flows, and (2) increase the potential for mass- and concentration-violations of the discharge permit. From the standpoint of the City of Arcata, the most favorable location of the discharge point would be downstream of the brackish marsh, i.e., at the tide gate. The hydraulic regimes shown in Figures \ref{fig:tm-all-series} through \ref{fig:tm-none} represent varying levels of compromise between the City and Regional Board.

The existing regime is shown in Figure \ref{fig:tm-current}, where effluent from Hauser returns to the chlorine basin prior to final discharge. The most favorable integration scheme would place the brackish marsh in series with the existing system (Figure \ref{fig:tm-all-series}). This scheme would provide the greatest level of treatment, and requires a minimal re-distribution of flow. In contrast, the regime shown in Figure \ref{fig:tm-none} would provide no treatment from the enhancement wetlands and requires the greatest effort by the City to meet discharge requirements using only the wetlands upstream of the chlorine basin.

The City plans to renovate a series of fish ponds adjacent to the existing treatment marshes. The fish ponds, as well as oxidation pond 3, will be re-distributed as treatment marshes 5, 6, and 7 (Appendix). The additional storage and treatment capacity may produce effluent of sufficient quality for direct chlorination and discharge (\begin{it}Gearheart\end{it}, 2008).

\subsection{Data Sources}\label{sec:data}

The hydraulic model discussed in Section \ref{sec:reservoir-model} requires three forms of data: (1) predicted inflow (both precipitation and municipal influent), (2) predicted sea-surface elevations, and (3) model parameters, e.g., weir elevations, pond areas, etc. Predicted precipitation is obtained daily from the National Weather Service forecast database (\begin{it}NWS\end{it},2008); this data is used to drive the municipal inflow prediction model described in Section \ref{subsec:inflow-model}. Rainfall data was also obtained from an independent observer (\begin{it}Ruegg\end{it}, 2008) in the vicinity of the treatment plant. Correlations between plant inflow and either of the rainfall data sets were equally strong. We use the NWS data set, as forecasted data is readily available. 

Predicted sea surface elevations downstream of the tide-gate are provided by a local branch of the National Oceanic and Atmospheric Administration (NOAA). NOAA has implemented a regional circulation model, ADCIRC, that predicts tidally-forced and wind-driven seas througout Humboldt Bay. ADCIRC (an ADvanced CIRCulation model supported by the Army Corps of Engineers) is driven by local tidal harmonics, retreived from the WaveWatch III Eastern North-Pacific database (\begin{it}ENPAC\end{it}, 2003), and model-derived winds from the Global Forecast System (GFS40) and the North American Mesoscale model (NAM12) - all of which are supported by the National Weather Service. Finally, wetland parameters have been obtained from direct measurement, recent GIS surveys \citep{Kang2008}, planning documents \citep{CH2MHILL}, and personal communication with treatment plant operators \citep{Clinton2008}.

\begin{figure}[!tbp]
\centering
\subfigure[\label{fig:tm-current}]{
\includegraphics{figs/tm-current.pdf}}
\subfigure[\label{fig:tm-all-series}]{
\includegraphics{figs/tm-all-series.pdf}}
\subfigure[\label{fig:tm-allen}] {
\includegraphics{figs/tm-allen-only.pdf}}
\subfigure[\label{fig:tm-nohauser}] {
\includegraphics{figs/tm-no-hauser.pdf}}
\subfigure[\label{fig:tm-none}] {
\includegraphics{figs/tm-none.pdf}}
\caption{(a) Existing regime. (b) The brackish marsh is connected in series to the existing regime. (c) Only the Allen Marsh is used for treatment. (d) The Hauser Marsh is bypassed. (e) The enhancement wetlands are removed from the treatment system.}
\end{figure}


\section{Literature Review}\label{sec:litrev}

\subsection{Wetland Models}

Numerous wetland models have been developed, predominantly as tools 
for research in natural wetlands. Many of these models incorporate
both hydraulic and nutrient dynamics, though presently we are only
concerned with hydraulics. Two broad categories exist - lumped and
distributed flow models.

Distributed flow models attempt to resolve flow patterns within a
given wetland using the equations of momentum- and
mass-conservation. The advantage of such models is the ability to
capture small-scale processes, e.g., short-circuiting and dead-zones
within a given wetland. Various authors have proposed mathematical
expressions to approximate fluid flow in wetlands and
frictional-resistance due to vegetation and bottom roughness. The
most common forms are variations on Manning's equation  (a standard
formula used to simulate open-channel flow) and the diffusion
equation (most often used to simulate flow through porous media).

\cite{Guertin1987} developed a distributed model, PHIM, for
wetlands typical of those found in the Great Lakes region. PHIM is
based on a modified form of Manning's equation. Input to PHIM is
limited to climactic data (precipitation, humidity, etc.) and
wetland parameters (soil depth, vegitation thickness, etc.). The
model was applied to a watershed in northern Minnesota. Short term
flow predictions were within one standard deviation of the observed
values. \cite{Hammer1986} developed a similar distributed flow
model, using the Kadlec equation \citep{Kadlec1990} to approximate
vegitation-resistance to flow. The model was applied to a wetland in
Porter Ranch, Michigan, giving useful short-term predictions. A
WETLANDS package for the USGS groundwater model MODFLOW, was
developed for the South Florida Water Management District to better
understand the effect of nearby urbanization on wetlands above the
Biscayne Aquifer \citep{Montoya1998}. The package is capable of
simulating interaction between wetlands and underlying groundwater.
However, the simultaneous solution of overland- and subsurface-flow
equations is computationally intensive. MIKE-SHE, developed by the
Danish Hydraulic Institute, is similar to MODFLOW and capable of
modeling wetland sloughs, groundwater interaction, and select
hydraulic control structures, e.g., weirs and sluice gates.
\cite{Thompson2004} tested the model extensively with data obtained
at the Elmley Marshes in the United Kingdom, and obtained good
agreement between observed and predicted flow rates.

Lumped flow models have also been developed for purposes of planning
and management. Such models are less computationally intensive, and
are preferred in scenarios where limited data is available regarding
the physical description of the system under investigation. Lumped flow
models attempt to resolve large scale flow processes, e.g., the net
movement of water into and out of a water body. The water balance is
expressed mathematically in terms of mass conservation (not momentum
conservation). Reservoir models, a particular class of lumped flow
models, discretize a watershed into a series of inter-connected
reservoirs.

Among the more well known lumped-flow packages are HEC-RAS and
PondPack. HEC-RAS, originally developed by the Army Corps of
Engineers for river analysis, has been proposed as a possible
wetland model for scenarios where sloughs and vegetated channels are
predominant \citep{HEC2008}. PondPack is a linear-reservoir model,
designed to simulate detention pond systems. PondPack is capable of
simulating various control structures, e.g., weirs and sluice-gates,
as well as climactic influences, e.g., precipitation and evaporation
\citep{Bentley2005}. \cite{Lee1999} developed the reservoir model
SETWET as a tool for managing pollution control in natural wetlands.
SETWET is capable of simulating both hydraulic- and
nutrient-dynamics. The model was validated using data collected at
Benton, Kentucky, and in the Nomini Creek watershed in Virginia. A
detailed statistical analysis of the results reveals both strengths
and weaknesses in the model.

\subsection{Tide Gates}

The purpose of the tide gate, situated at the interface between the brackish marsh and the bay, is two fold: (1) to regulate volumetric flow into and out of the brackish marsh, thereby regulating salinity in the marsh, and (2) to allow fish passage via the pet door in Figure \ref{tidegate} \citep{Andre2008}. The tide gate (patented under the title 'Muted Tidal Regulator') was installed by Nehalem Marine. A buoy on the marsh side is linked to a mechanical arm which regulates the pet door. The tide gate behaves as follows:

\begin{myen}
        \item {\it When not submerged on the bay side:} The circular door acts a counter-weight; the size of the opening is a function of the upstream head (the relationship can be approximated by a hydrostatic force balance).
	\item{\it When submerged:} The size of the opening of the circular door is a function of the both the upstream and downstream heads.The gate can only open towards the bay, and shuts when the sea surface is above the water level within the marsh. In this case, bay water can only enter the marsh through the pet door.
	\item{\it High water in the marsh:} The pet door shuts mechanically when the water level in the marsh reaches a particular threshhold (the threshhold is adjustable).   
\end{myen} 

The hydraulic model discussed in section \ref{sec:reservoir-model} requires a rating curve at the tide gate. In practice, because tide gate behavior varies by design, rating curves are most often obtained by experimental methods \citep{Burt2001}. In some cases though, rating curves are determined via theoretical models. \cite{Litrico2005}, \cite{Belaud2008}, and \cite{Burt2001} assume the gate behaves as an orifice when the angle of opening is small. The size of the orifice is determined in each case by a force balance. In the case of rectangular gates, \cite{Belaud2008} assumes that flow around the vertical sides of the gate can be approximated by rectangular weir requations, modified by a factor related to the degree of submergence. 

\begin{figure}[!tb]
\centering
\includegraphics[width=.6\textwidth]{figs/tidegate.jpg}
\caption{The ``Muted-Tidal-Regulator'' tide gate, equipped with square pet door.}
\label{tidegate}
\end{figure}

\subsection{Inflow Prediction}\label{subsec:inflow-model}

As discussed, the treatment facility was designed to treat an average of 2.3 mgd, though daily inflows fluctaute with climactic variables. In particular, daily inflows to the AWTF are heavily influenced by groundwater infiltration to the municipal sewer system \citep{Finney2008}. In turn, the degree of infiltration is, for the most part, a function of recent precipitation. An intuitive approach for predicting plant inflows would therefore be a correlation scheme between inflow and recent precipitation - many authors have proposed just this.

\cite{El-Din2002} present a correlation model based on artifical neural networks (ANNs) to predict inflows to the Gold Bar Wastewater Treatment Plant in Alberta, Canada. The neural network was capable of predicting inflows to $\pm$ 1.0 cms (where baseflow was ~3.5 cms and peak flows were between 10-11 cms) by correlating inflow with precipitation recorded at several nearby rain gauges. \cite{Coulibaly2005} improved upon the reliability of the same scheme by combining three models via a weighted average. A nearest neighbor model (NNM) was used to corellate inflow with two previous days of river flow, the previous day's precipiation, and a 24-hr precipitation forecast. The same inputs were used in an artificial neural network. The third model was based on a conceptual water balance of the local river basin.

 
\section{Methodology}\label{sec:meth}

\subsection{Linear-Reservoir Model}\label{sec:reservoir-model}

This section will provide a rough mathematical framework for the
linear-reservoir model used to simulate hydraulic behavior of the
constructed wetlands. The linear reservoir model employs the
following assumptions herein: (1) the water surface of each reservoir
remains level at all times, i.e., no prism storage occurs, (2) the
stage discharge relationship exhibits no hysteresis, i.e., the
relationship is identical during filling and emptying of the
reservoir, (3) the stage of each reservoir is essentially constant
during some small time interval $\Delta t$, such that the discharge
is also constant during the same interval. The mathematical model is
an expression of mass conservation (Equation \ref{mass_balance_1}),
where $S$ is the storage volume, $Q_{in}$ is the volumetric inflow
during time $\Delta t$, and $Q_{out}$ is the volumetric outflow.

\[\frac{\Delta S}{\Delta t} = Q_{in}-Q_{out}\label{mass_balance_1}\]

If the surface area of the reservoir is independent of depth, the
equation can be expressed in terms of the surface elevation $H$, and
surface area $A$ (Equation \ref{mass_balance_2}).

\[A\frac{\Delta H}{\Delta t} = Q_{in}-Q_{out}(H)\label{mass_balance_2}\]

$Q_{out}(H)$ is now the stage-discharge relationship, which depends
on the parameters of the outfall structure. \cite{King1963} present
the most widely accepted equations of flow over submerged and
non-submerged weirs (Equations \ref{submerged_weir} and
\ref{nonsubmerged_weir}, respectively), assuming negligible approach
velocities in both cases. The same authors present equations for
frictional losses through pipes and gates (Equations \ref{pipes} and
\ref{gates}, respectively), assuming turbulent flow in both cases.

\[ Q=(2g)^{\frac{1}{2}}L\left[\frac{2}{3}(H-D)^{\frac{2}{3}}+D(H-D)^{\frac{1}{2}}\right] \label{submerged_weir}\]

\[ Q=\frac{2}{3}(2g)^{\frac{1}{2}}LH^{\frac{3}{2}} \label{nonsubmerged_weir}\]

\[h_p = \frac{8flQ^2}{d^5\pi^2g}\label{pipes}\]

\[h_g = K_g\frac{v^2}{2g}\label{gates}\]

Above, $Q$ is the volumetric flow rate, $v$ is the velocity of flow,
$w$ is the width of a weir, $H$ and $D$ are respectively the
upstream and downstream heads above the crest of a weir, $g$ is the
acceleration due to gravity, $h_p$ and $h_g$ are frictional head
losses through a pipe and gate, $d$ and $l$ are respectively the
pipe-diameter and pipe-length, $K_g$ is a dimensionless coefficient
of head-loss through a gate, and $f$ is a dimensionless friction
factor - roughly 0.01 for turbulent flow through PVC pipes similar
to those at the constructed wetlands \citep{White2008}.

Calculating the flow from one reservoir to another through a control
structure such as that in Figure (\ref{tidegate}) requires apriori
knowledge of frictional losses. However, calculation of the
frictional losses requires apriori knowledge of the magnitude of
flow. We use the iterative procedure described by \cite{Chow1988} to
solve this problem (Figure \ref{flowchart}). The hydraulic behavior
of the system is controlled primarily by the elevation of the weirs,
which are seldom adjusted in practice. As such, the corresponding
parameters of the model are held constant during any given
simulation. Equation \ref{mass_balance_2} is numerically integrated
during each time step using a third-order Runge Kutta algorithm,
described in mathematical detail by \cite{Chow1988}. A diagram of
the entire simulation process is shown in Figure (\ref{flowchart}).

\begin{figure}[!tb]
\centering
\includegraphics[width=.7\textwidth]{figs/flowchart.pdf}
 \caption{A conceptual simulation process diagram.}
 \label{flowchart}
\end{figure}

\subsection{Inflow Model}

Rainfall and inflow time-series obtained from the sources listed in section \ref{sec:data} exhibit the following behavior: (1) a seasonal periodic trend, (2) nonstationarity, i.e., fluctuation of the running average, and (3) daily fluctuation, herein referred to as \begin{it}residual\end{it}. A useful predictive model must account for each of the three components to accurately forecast plant inflows. We use the Seasonal-Trend Loess (STL) procedure outlined in \cite{Cleveland1990} to decompose both time-series. The procedure has the advantage of being able to robustly deconstruct periodicity where jumps, slips, and missing values are present \citep{Cleveland1990}. After decomposition, we are left with the residuals of each time-series (Figure \ref{fig:STL}).

\begin{figure}[!tb]
\centering
\includegraphics[width=.7\textwidth]{figs/STL.pdf}
\caption{The inflow prediction model, based upon the Seasonal-Trend Loess procedure, is shown conceptually.}\label{fig:STL}
\end{figure}

As shown in Figure \ref{fig:STL}, we assume a linear correlation between the residuals of the rainfall and inflow time-series. We expect that daily plant inflow is strongly influenced by rainfall over the previous $m$ days. Hence, we correlate each value of inflow-residual to the sum of rainfall-residual over the previous $m$ days. In practice, we have found the best results with $m=3-5$. We assume that nonstationarity is small compared to seasonal and residual components, and use the average value of the nonstationary component as a respresentative value.

Figure \ref{fig:ts} illustrates the correlation between rainfall and inflow residuals. Rainfall residuals found using the STL procedure are shown in blue and inflow residuals in black. Notice that each peak in the rainfall residual has a corresponding peak in the inflow residual. Also notice that the magnitude of each peak in the inflow residual series is influenced by rainfall that occured within a window of time in the past. The relationship exhibits hysteresis, e.g., because the water table tends to rise as the wet season progresses.  

\begin{figure}[!tb] %  figure placement: here, top, bottom, or page
   \centering
   \includegraphics[height=\textwidth,angle=-90]{figs/inflow-ts.pdf}
   \caption{There is an apparent correlation between inflow residuals (black) and rainfall residuals (blue).}
   \label{fig:ts}
\end{figure}

\section{Application}

\subsection{Linear-Reservoir Model}

Hydraulic behavior of the constructed wetlands is complex. While the
oxidation ponds are generally free of obstruction, the treatment and
enhancement marshes contain a layer of dense vegetation (Figure
\ref{vegitation}). Bathymetry of the system is irregular and
changing in time due to the presence of sludge and litter. Bottom
depths are difficult to measure and vary over lateral distances of
less than 10 meters. Flow paths are affected not only by the local
variation just described, but also by the location and elevation of
weirs and similar control structures. For instance, slight
differences in the elevation of adjacent weirs - on the order of
centimeters - can create or destroy large dead-volumes in a given
pond or marsh. Such complexity precludes the development of an
accurate distributed flow model of the wetlands - at least within
the time frame of this study. More importantly, a distributed flow
model would be inappropriate for the desired resolution of predicted
flows (in both time and space).

\begin{figure}[!tb]
\centering
\includegraphics[width=.5\textwidth]{figs/vegitation.jpg}
\caption{A photograph of the submerged layer of vegetation in the
treatment wetlands.}
\label{vegitation}
\end{figure}

Although the system is complex, several factors exist which make the
task of modeling more tractable. The time scale during which
complex/localized flow processes occur is small in comparison to the
hydraulic residence times of each wetland body. As a result, water
surfaces in the wetlands are nearly horizontal during all but the
most extreme conditions. In addition, changes in water surface
elevations occur on the time scale of hours to days, i.e., during a
given simulation we can safely assume that depths are constant on
the time scale of minutes. In short, the hydraulic behavior of the
wetlands is less complex over large time scales. Because this is the
desired resolution of prediction, and because of the
nearly-horizontal water surfaces, a linear reservoir (level-pool)
model is appropriate.

The mathematical development of the linear-reservoir model was
discussed in section \ref{sec:reservoir-model}. Here, we describe only the
parameters of the system. The wetlands are described in the model as
a series of interconnected linear-reservoirs, each have multiple
inlets and outlets (Figure \ref{schematic}, Appendix). Each component of the
hydraulic control system is represented by a prototypical structure with various
parameters (Figure \ref{prototype}). For example, to represent a
gated pipe the structure would have the following parameters:
$l_1$=20ft, $f_1$=0.01, $g_1$=0.5, and the remaining parameters
would be set to zero. The tide-gate which connects the brackish marsh 
to the bay is modeled via a rating-curve provided by the user. The rating
curve is discrete, and specifies the volumetric flow corresponding to
paired data - each paired data point specifies the upstream and 
downstream hydraulic head. 

The linear-reservoir model, coupled with the equations of flow through 
the control structures mentioned above, was implemented in the 
computer-language ``R''. Calibration of the model was accomplished by varying the frictional
losses and pipe-lengths at each control structure, such that steady-state depths correspond to the observed
dry-weather values, assuming a constant dry-weather plant inflow of
~2.5 mgd, using a computational time-step of $\Delta t$ = 10 minutes. 

\begin{figure}[!b]
\centering
\includegraphics[width=.7\textwidth]{figs/prototype.pdf}
\caption{A prototypical control structure with labeled parameters.}
\label{prototype}
\end{figure}

%looks for the bibtex file refs.bib
\addcontentsline{toc}{section}{References}
\bibliography{../../group/references}

\section{Appendix}

\begin{figure}[!htbp]
\centering
\includegraphics[width=.8\textwidth, angle=90]{figs/schematic.pdf}
\caption{Aerial schematic of the constructed wetlands, including
control structures (numbered).}
\label{schematic}
\end{figure}

\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% Document Ends Here
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
